package com.sinaapp.mrblog.game.Assasin.model;

import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.sinaapp.mrblog.game.Assasin.util.AssasinManager;

public class Footprint extends BaseActor{
	
	public static final int FOOTPRINT_STATE_BIRTH = 0;
	public static final int FOOTPRINT_STATE_DYING = 1;
	public static final int FOOTPRINT_STATE_DIED = 2;
	
	public static final float FOOTPRINT_WIDTH = 1;
	public static final float FOOTPRINT_HEIGHT = 1;
	public static final float BIRTH_STATE_TIME = 3;
	public static final float DYING_STATE_TIME = 8;
	
	public static final float FOOTPRINT_DIS = 1.5f;
	public static final float TOUCH_FLOOD_TIME = 8f;
	
	public Footprint(BaseActor actor) {
		super(actor.getCenterX()-FOOTPRINT_WIDTH/2, actor.getCenterY()-FOOTPRINT_HEIGHT/2, FOOTPRINT_WIDTH, FOOTPRINT_HEIGHT);
		setState(FOOTPRINT_STATE_BIRTH);
		alpha = 1;
		this.angle = actor.angle;
	}


	@Override
	public void act(float delta) {
		region = AssasinManager.footprintRegion;
		if(getState() == FOOTPRINT_STATE_BIRTH&&getStateTime()>BIRTH_STATE_TIME){
			setState(FOOTPRINT_STATE_DYING);
		}else if(getState() == FOOTPRINT_STATE_DYING){
			alpha -= 1/DYING_STATE_TIME*delta;
		}
		
		if(alpha<0){
			setState(FOOTPRINT_STATE_DIED);
		}
					
		super.act(delta);
	}


	@Override
	public void refreshStatus() {
		// TODO Auto-generated method stub
		
	}


	@Override
	public TextureRegion getReadyRegion() {
		// TODO Auto-generated method stub
		return null;
	}

}
